#ifndef GAMESTATE_H
#define GAMESTATE_H

#include <QObject>

#include "state.h"
#include "gamewindow.h"
#include <mlgesture.h>
#include <QTimer>
#include <QTime>
#include "resultwidget.h"
#include <gestureobserver.h>

class GameState : public State, public mlgesture::GestureObserver
{
	Q_OBJECT
public:
    GameState();
	~GameState();
	void enter();
	void exit();
	void setParams(int cam_id=-1, int low_skin=-1, int upper_skin=-1, int low_value=-1, int upper_value=-1,
			  bool adapt_algorithm=true, double tracking_sensity_=-1, bool show_camera_img=-1, bool show_mask_img=-1);
	void resetParams();
	void processEvent(mlgesture::GestureEvent *event);

private:
	GameWindow *window_;
	resultWidget *resultWindow_;
	bool showCameraImg_;
	bool showMaskImg_;
	mlgesture::MLGesture *gesture_;
	QTimer *timer_;
	QTime time_;
	bool isEnd_;
	bool isShooting_;

private slots:
	void returnMenu();
	void endGame();
	void process();
};

#endif // GAMESTATE_H
